Fix gnttab bug in blkfront.
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Thu, 28 Jul 2005 09:10:05 +0000 (09:10 +0000)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Thu, 28 Jul 2005 09:10:05 +0000 (09:10 +0000)
Signed-off-by: Keir Fraser <keir@xensource.com>
linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c

index 07dd06fed6050c23929ac7443bf9c7a458a5ba99..1f524e3008357b29c57d783319dd9961c24d8782 100644 (file)
@@ -1428,8 +1428,9 @@ int __init xlblk_init(void)
     int i;
 
 #ifdef CONFIG_XEN_BLKDEV_GRANT
-    if ( 0 > gnttab_alloc_grant_references( MAXIMUM_OUTSTANDING_BLOCK_REQS,
-                                            &gref_head, &gref_terminal ))
+    /* A grant for every ring slot, plus one for the ring itself. */
+    if ( 0 > gnttab_alloc_grant_references(MAXIMUM_OUTSTANDING_BLOCK_REQS + 1,
+                                           &gref_head, &gref_terminal) )
         return 1;
     printk(KERN_ALERT "Blkif frontend is using grant tables.\n");
 #endif